<!DOCTYPE html>
<html class="ui-page-login">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>金银商城 - 找金银网旗下金银珠宝精品商城</title>
		<link href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/mui.min.css" rel="stylesheet" />
		<link href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/style.css" rel="stylesheet" />
		<link href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/zhaojinyin_index.css" rel="stylesheet" />
		<link href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/app.css" rel="stylesheet" />
		<?php /*
		<script src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/mui.min.js"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			(function($, doc) {
				$.plusReady(function() {
					//login
					doc.getElementById('login').addEventListener('tap', function() {
						$.openWindow({
							url: 'login.html'
						});
					}, false);
				});
			}(mui, document));
		</script>*/?>
		<script type="text/javascript">
			function get_sms_captcha(type){
				if($("#mobile").val().length == 11){
					var ajaxurl = 'index.php?act=seccode&op=get_captcha&nchash=3&type='+type;
					ajaxurl += '&captcha=true&phone='+$('#mobile').val();
					$.ajax({
						type: "GET",
						url: ajaxurl,
						async: false,
						success: function(rs){
							if(rs == 'true') {
								alert('短信动态码已发出');
							} else {
								alert(rs);
								//window.location.href='index.php?act=login&op=register';
							}
						}
					});
				}else{
					alert('请输入手机号');
				}
			}
		</script>
		<style>
			.area {
				margin: 20px auto 0px auto;
			}
			
			.mui-input-group {
				margin-top: 10px;
			}
			
			.mui-input-group:first-child {
				margin-top: 20px;
			}
			
			.mui-input-group label {
				width: 22%;
			}
			
			.mui-input-row label~input,
			.mui-input-row label~select,
			.mui-input-row label~textarea {
				width: 78%;
			}
			
			.mui-checkbox input[type=checkbox],
			.mui-radio input[type=radio] {
				top: 6px;
			}
			
			.mui-content-padded {
				margin-top: 25px;
			}
			
			.mui-btn {
				padding: 10px;
			}
			
			.link-area {
				display: block;
				margin-top: 25px;
				text-align: center;
			}
			
			.spliter {
				color: #bbb;
				padding: 0px 8px;
			}
			
			.oauth-area {
				position: absolute;
				bottom: 20px;
				left: 0px;
				text-align: center;
				width: 100%;
				padding: 0px;
				margin: 0px;
			}
			
			.oauth-area .oauth-btn {
				display: inline-block;
				width: 50px;
				height: 50px;
				background-size: 30px 30px;
				background-position: center center;
				background-repeat: no-repeat;
				margin: 0px 20px;
				/*-webkit-filter: grayscale(100%); */
				border: solid 1px #ddd;
				border-radius: 25px;
			}
			
			.oauth-area .oauth-btn:active {
				border: solid 1px #aaa;
			}
			
			.mui-input-row,
			.mui-input-group:before,
			.mui-input-group .mui-input-row:after,
			.mui-input-group:after {
				background: #FFFFFF;
			}
		</style>

	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" onclick="history.go(-1);"></a>
			<h1 class="mui-title">找回密码</h1>
		</header>
		<div class="mui-content" style="background: #FFFFFF; text-align: center;">
			<script type="text/javascript" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/jquery.js"></script>
			<script type="text/javascript" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/jquery.validation.min.js"></script>
			<img src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/images/8896.png" style="width: 80%; margin: 18px auto;" />
			<form id='login-form' class="mui-input-group" style=" border: 1px solid #c8c7cc;  border-radius: 3px; width: 95%; margin: 0 auto;" method="post" action="index.php?act=login&op=forget">
				<?php Security::getToken();?>
				<input type="hidden" name="form_submit" value="ok" />
				<input name="nchash" type="hidden" value="<?php echo getNchash();?>" />
				<div class="mui-input-row" style="line-height: 50px; height: 50px; border-bottom: 1px solid #c8c7cc;">
					<label><img style="width: 25px;" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/images/phone4.png"></label>
					<input style="height: 50px;" type="text" name="mobile" id="mobile" class="mui-input-clear mui-input" placeholder="手机号">
				</div>
				<div class="mui-input-row" style="line-height: 50px; height: 50px; border-bottom: 1px solid #c8c7cc;">
					<label><img style="width: 25px;" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/images/99656.png"></label>
					<input style="height: 50px;width: 120px;float: left;" type="text" class="mui-input-clear mui-input" id="captcha" name="captcha" placeholder="请输入验证码">
					<a style="float: right;width: 100px;line-height: 50px;" onclick="get_sms_captcha('1')">获取验证码</a>
				</div>

				<div class="mui-input-row " style="line-height: 50px; height: 50px;border-bottom: 1px solid #c8c7cc; ">
					<label><img style="width: 25px;" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/images/mima4.png"></label>
					<input style="height: 50px;" type="password" class="mui-input-clear mui-input" name="password" id="password" placeholder="请输入密码">
				</div>
				<div class="mui-input-row " style="line-height: 50px; height: 50px; ">
					<label><img style="width: 25px;" src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/images/mima4.png"></label>
					<input style="height: 50px;" type="password" class="mui-input-clear mui-input" name="confirm" id="confirm" placeholder="请确认密码">
				</div>
			</form>
			<div class="mui-content-padded ">
				<button id='reg' class="mui-btn mui-btn-block mui-btn-primary " >修改密码</button>
				</div>
			</div>
			<div class="mui-content-padded oauth-area ">

			</div>
		</div>
		<script type="text/javascript">
			$(function(){
				$("#reg").click(function(){
					if(!document.getElementById('godo').checked){
						alert('请同意找金银网用户服务协议');
					}else if(!$("#mobile").val()) {
						alert('手机号不能为空');
					}else if(!$("#captcha").val()){
						alert('请输入验证码');
					}else{
						$("#submit").trigger("click");
					}
				});

				$("#login_form").validate({
					//放置错误提示的方法
					errorPlacement: function(error, element){
						var error_td = element.parent('span');
						// error_td.find('label').hide();
						error_td.append(error);
					},
					rules: {
						mobile: {
							required	: true,
							mob_v 	: true,
							remote   : {
								url : 'index.php?act=login&op=checkMobile',
								type: 'get',
								data:{
									mobile : function(){
										return $('#mobile').val();
									}
								}
							}
						},
						password: {
							//  required	: true
							// minlength 	:6
							// pwd_v 	: true
						}
						,captcha : {
							required : true

						},
						godo : {
							required : true
						}
					},
					messages: {
						mobile: {
							required	: '手机号码不能为空',
							mob_v	:	'手机号码输入错误',
							remote   :	'手机号码已存在'
						},
						password: {
							required:'密码不能为空',
							//  pwd_v:''
						}
						,captcha : {
							required : '验证码不能为空'
						},
						godo:{
							required : '请同意找金银网用户服务协议'
						}
					}
				});
		 });

		</script>
	</body>

</html>